package y24.m4;

public class Test4 {
    static class Car{
        private Integer speed;
        private String kind;
        private String color;
        private Double price;

        public void setCar(Integer speed, String kind, String color, Double price) {
            this.speed = speed;
            this.kind = kind;
            this.color = color;
            this.price = price;
        }
        public Car getCar(){
            Car car = new Car();
            car.color = color;
            car.speed = speed;
            car.kind = kind;
            car.price = price;
            return car;
        }

        @Override
        public String toString() {
            return "Car{" +
                    "speed=" + speed +
                    ", kind='" + kind + '\'' +
                    ", color='" + color + '\'' +
                    ", price=" + price +
                    '}';
        }
    }

    public static void main(String[] args) {
        Car car = new Car();
        car.setCar(120,"长安","白色",120000.0);
        System.out.println(car.getCar());
    }
}
